package com.labirynt.mat;


public class Rectangle {
    public final Vector2 lowerLeft;
    public float width, height;
    
    public Rectangle(float x, float y, float width, float height) {
        this.lowerLeft = new Vector2(x,y);
        this.width = width;
        this.height = height;
    }
/*
    struct
    {
        LONG    left;
        LONG    top;
        LONG    right;
        LONG    bottom;
    } RECT;

    bool IntersectRect(const RECT * r1, const RECT * r2)
    {
    	return ! ( r2->left > r1->right
    		|| r2->right < r1->left
    		|| r2->top > r1->bottom
    		|| r2->bottom < r1->top
    		);
    }
*/
    boolean IntersectRect(Rectangle  r2)
    {
    	return ! ( r2.lowerLeft.X >this.width
    		|| r2.width < this.lowerLeft.X
    		|| r2.height > this.lowerLeft.Y
    		|| r2.lowerLeft.Y < this.height
    		);
    }
}
